<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
use think\Request;
use think\Session;
use auth\Auth;

class Auths extends Controller
{
    public function check_node()
    {
      $AUTH = new \auth\Auth();//加载外部类
      if (Session::get('uid')) {
        if (!session('?super_admin') || !session('super_admin')) {
          $node = Request::instance()->get('url');
          //$node = request()->module() . '/' . request()->controller() . '/' . request()->action();//模板——控制器——方法
          if(!$AUTH->check($node,Session::get('uid'))){
            // echo $node;
            //$this->error('没有权限','/index/start/#/user/login');
            $code='1002';
            $arr='';
            $msg='没有权限';
            $this->result($arr,$code,$msg);
          }else{
            $this->result('','0','用户正常');
          }
        }
      }else{
        $code='1001';
        $arr='';
        $msg='请登录';
        $this->result($arr,$code,$msg);
      }
    }
}
